//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Web.UI;
using System.Web.UI.WebControls;
using CommunityServer.Components;

namespace CommunityServer.Controls 
{
	public class Footer : WebControl 
	{
		CSContext csContext = CSContext.Current;

		protected override void Render(HtmlTextWriter writer)
		{
			if (!Globals.IsNullorEmpty(csContext.SiteSettings.Copyright))
			{
				writer.WriteLine("<div class=\"Copyright\">" + csContext.SiteSettings.Copyright + "</div>");
			}

			if(!Telligent.Registration.CommunityServer.IsStandard)
			{
				writer.Write("<a target=\"_blank\" href=\"http://communityserver.org/r.ashx?1\"><img alt=\"" + string.Format(ResourceManager.GetString("Footer_PoweredBy"), "Community Server (Personal Edition)") + "\" border=\"0\" src=\"" + Globals.GetSiteUrls().Home + "utility/PoweredByCS_personal.GIF" + "\"/></a>");
			}
			else if(csContext.SiteSettings.EnableEula)
			{
				writer.Write("<a target=\"_blank\" href=\"http://communityserver.org/r.ashx?j\"><img alt=\"" + string.Format(ResourceManager.GetString("Footer_PoweredBy"), "Community Server (Commercial Edition)") + "\" border=\"0\" src=\"" + Globals.GetSiteUrls().Home + "utility/PoweredByCS_commercial.GIF" + "\"/></a>");
			}
		}
	}
}
